package cn.hl.sfzy.service.impl;

import cn.hl.sfzy.entity.FM;
import cn.hl.sfzy.mapper.FMMapper;
import cn.hl.sfzy.service.FMService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName FMServiceImpl
 * @Description TODO
 * @Author yangshen
 * @Date 2024年10月24日 11:25
 * @Version 1.0
 */
@Service
public class FMServiceImpl implements FMService {
    @Autowired
    private FMMapper fmMapper;
    @Override
    public PageInfo find(Integer pageNum,Integer pageSize, FM fm) {
        PageHelper.startPage(pageNum,pageSize);
        List<FM> fms = fmMapper.find(fm);
        PageInfo<FM> fmPageInfo = new PageInfo<>(fms);
        return fmPageInfo;
    }

    @Override
    public int add(FM fm) {
        return fmMapper.add(fm);
    }

    @Override
    public int delete(long id) {
        return fmMapper.delete(id);
    }

    @Override
    public int update(FM fm) {
        return fmMapper.update(fm);
    }
}
